//////////////////////////////////////////////////////////////////////////////////////////
//   _  _ ____ _  _ ___  ____                                                           //
//   |_/  |__| |\ | |  \ |  |    This file belongs to Kando, the cross-platform         //
//   | \_ |  | | \| |__/ |__|    pie menu. Read more on github.com/kando-menu/kando     //
//                                                                                      //
//////////////////////////////////////////////////////////////////////////////////////////

// SPDX-FileCopyrightText: Simon Schneegans <code@simonschneegans.de>
// SPDX-License-Identifier: MIT

@use '../../variables.scss' as *;

.menuList {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.menuListContent {
  position: relative;
  min-height: 0px; // This is important to make the scrollboxes work.
  background-color: $window-background;
  border-top-left-radius: 10px;
  flex-grow: 1;
  border-top: $area-border;
  border-left: $area-border;
}

.menu {
  display: block;
  background-color: $widget-normal;
  color: $text-normal;
  border: 1px solid transparent;

  padding: 10px;
  border-radius: 8px;
  margin-bottom: 8px;
  text-align: left;
  width: 100%;

  transition: box-shadow 0.2s;

  * {
    pointer-events: none;
  }

  &.selected {
    background-color: $widget-selected;
    border: $border-selected;

    &:hover {
      background-color: $widget-selected-hover;
    }
  }

  &:hover {
    background-color: $widget-normal-hover;
  }

  &:active {
    transform: translateY(1px);
  }

  // Leave some space at the bottom of the menu list for the floating button.
  &:last-child {
    margin-bottom: 75px;
  }

  // A low opacity seems to be required. Setting it to zero hides also the dragged copy
  // at the pointer.
  &.dragging {
    opacity: 0.001;
  }

  &.dropping {
    box-shadow: $drop-highlight;
  }
}

.menuTitle,
.menuSubtitle {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.menuTitle {
  font-size: 1rem;
}

.menuSubtitle {
  color: $text-muted;
  font-size: 0.8rem;
}

.floatingButton {
  position: absolute;
  bottom: 20px;
  width: 100%;
  text-align: center;
}

.message {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-align: center;
  height: 70vh;

  > * {
    width: min(250px, 80%);
  }
}
